package pt.ipl.isel.deetc.leic.pdm.g12.yamba;

import java.util.TreeMap;

@SuppressWarnings("serial")
public class Status extends TreeMap<String, Object> {
	public static final String KEY_ID = "id";
	public static final String KEY_USER = "user"; 
	public static final String KEY_TIME = "time";
	public static final String KEY_STATUS = "status";
	public static final String KEY_STATUS_PREVIEW = "statusPrev";
	
	public Status(long id, String user, String createdAt, String status, int preview) {
		put(KEY_ID, id);
		put(KEY_USER, user);
		put(KEY_TIME, createdAt);
		put(KEY_STATUS, status);
		put(KEY_STATUS_PREVIEW, 
				status.length() > preview ? status.substring(0, preview+1) : status );
	}
	
	public Long getId() {
		return (Long)get(KEY_ID);
	}
	
	public String getUser() {
		return (String)get(KEY_USER);
	}
	
	public String getTime() {
		return (String)get(KEY_TIME);
	}
	
	public String getStatus() {
		return (String)get(KEY_STATUS);
	}
	
	public String getStatusPreview(){
		return (String)get(KEY_STATUS_PREVIEW);
	}
}
